package com.maven.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.maven.bean.Department;
import com.maven.bean.Msg;
import com.maven.service.DepartmentService;

@RequestMapping("/departmentController")
@Controller
public class DepartmentController {

	@Autowired
	private DepartmentService departmentService;
	
	@RequestMapping("/getDepts")
	@ResponseBody
	public Msg getDepart(){
		List<Department> departments = departmentService.getDepts();
		return Msg.success().add("depts", departments);
	}
	
}
